<template>
    <div class="newsDetail">
        <h1>{{newsDetail.title}}</h1>
        <p class="time">发表时间：{{newsDetail.title_banner_txt_time}}</p>
        <div>
            <img :src="'http://psrecycle.oss-cn-hangzhou.aliyuncs.com/recycle/idcard/'+newsDetail.title_banner_img">
            <p>
                {{newsDetail.plate1_txt_content}}
            </p>
        </div>
    </div>
</template>
<script>
    export default {
        data(){
            return{
                params:this.$route.params.title,
                newsList:[],
                newsDetail:{}
            }
        },
        methods:{
            getlist(){
                this.$http.get("http://118.25.40.54:3000/apitext")
                    .then(info=>{
                        if(info.body!==undefined)
                        {
                           this.newsList =  info.body.data;
                        }
                    })
            }
        },
        watch:{
          newsList(newVal){
              this.newsDetail = newVal.filter(item=>{
                  if(item.title===this.params)
                  {
                      return item;
                  }
              })[0];
          }
        },
        created() {
            this.getlist();
        }
    }

</script>
<style scoped>
    .newsDetail{
        overflow: hidden;
    }
    .newsDetail>h1{
        text-align: center;
        font-family: 楷体;
        font-size: 60px;
        font-weight: bolder;
        margin: 30px 0 ;
    }
    .newsDetail>.time{
        font-size: 30px;
        text-align: center;
        margin: 10px 0 ;
    }
    .newsDetail>div>img{
        width: 100%;
    }
    .newsDetail>div>p{
        width: 100%;
        margin-top: 40px;
        font-family: 华文楷体;
        text-indent: 80px;
        font-size: 40px;
        line-height: 100px;
        word-wrap: break-word;
        padding: 0 20px;



    }
</style>